package util;

import java.util.ArrayList;
import java.util.Random;

public class utilTest {
	
	public static void main(String[] args) {
		
		System.out.println("-----start-----");
		//FileWriteTest1();
		//FileReadTest();
		FileWriteTest2();
		System.out.println("-----end-----");
	}
	
	static void FileWriteTes1t() {
		ArrayList<String> temp = new ArrayList<String>();

		Random rand = new Random(47);
		float test[] = new float[10];
		for(int i = 0 ; i < test.length ; i++) {
			test[i] = rand.nextFloat();
		}
		
		for(float f : test) {
			String s = Float.toString(f);
			System.out.println(s);
			temp.add("가 : " + s);
		}
		fileReadWrite writeTest = new fileReadWrite();
		writeTest.setInfo("c:/2/33.txt", "utf-8");
		writeTest.fileWrite(temp);
	}
	static void FileWriteTest2() {
		
		String temp = "test asdfasdfadsf";
		fileReadWrite writeTest = new fileReadWrite();
		writeTest.setInfo("c:/2/333.txt", "utf-8");
		for(int i = 0 ; i < 10 ; i++)
			writeTest.fileWrite(temp, false);
	}
	
	static void FileReadTest() {
		fileReadWrite readTest = new fileReadWrite();
		readTest.setInfo("c:/2/33.txt", "utf-8");
		ArrayList<String> tempList = readTest.fileRead();
		System.out.println("==========================================");
		for(String tempString : tempList) {
			System.out.println(tempString);
		}
		System.out.println("==========================================");
	}
}
